package cn.yj.consumer.service;

import cn.yj.frame.annotation.RpcReference;
import cn.yj.service.api.IHelloService;
import cn.yj.service.api.IYJRpcService;
import cn.yj.service.vo.YJRpc;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

/**
 * @author 永健
 * @since 2022-01-18 17:27
 */
@Service
public class TestService implements ApplicationRunner {

    private static final Logger log = LoggerFactory.getLogger(TestService.class);

    @RpcReference
    IHelloService helloService;

    @RpcReference
    IYJRpcService yjRpcService;


    public YJRpc test() {
        return yjRpcService.getYjRpc();
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.info("{}",yjRpcService.getYjRpc());
       log.info(helloService.getHello());
       log.info(helloService.sayHello("你好"));
    }
}
